using System;
namespace ns10
{
	public sealed class Mode
	{
		public static readonly Mode TERMINATOR;
		public static readonly Mode NUMERIC;
		public static readonly Mode ALPHANUMERIC;
		public static readonly Mode STRUCTURED_APPEND;
		public static readonly Mode BYTE;
		public static readonly Mode ECI;
		public static readonly Mode KANJI;
		public static readonly Mode FNC1_FIRST_POSITION;
		public static readonly Mode FNC1_SECOND_POSITION;
		private int[] int_0;
		private int int_1;
		private string string_0;
		public int Bits
		{
			get
			{
				return this.int_1;
			}
		}
		public string Name
		{
			get
			{
				return this.string_0;
			}
		}
		private Mode(int[] int_2, int int_3, string string_1)
		{
			this.int_0 = int_2;
			this.int_1 = int_3;
			this.string_0 = string_1;
		}
		public static Mode forBits(int bits)
		{
			switch (bits)
			{
			case 0:
			{
				Mode result = Mode.TERMINATOR;
				return result;
			}
			case 1:
			{
				Mode result = Mode.NUMERIC;
				return result;
			}
			case 2:
			{
				Mode result = Mode.ALPHANUMERIC;
				return result;
			}
			case 3:
			{
				Mode result = Mode.STRUCTURED_APPEND;
				return result;
			}
			case 4:
			{
				Mode result = Mode.BYTE;
				return result;
			}
			case 5:
			{
				Mode result = Mode.FNC1_FIRST_POSITION;
				return result;
			}
			case 7:
			{
				Mode result = Mode.ECI;
				return result;
			}
			case 8:
			{
				Mode result = Mode.KANJI;
				return result;
			}
			case 9:
			{
				Mode result = Mode.FNC1_SECOND_POSITION;
				return result;
			}
			}
			throw new ArgumentException();
		}
		public int getCharacterCountBits(Version version)
		{
			if (this.int_0 == null)
			{
				throw new ArgumentException("Character count doesn't apply to this mode");
			}
			int versionNumber = version.VersionNumber;
			int num;
			if (versionNumber <= 9)
			{
				num = 0;
			}
			else
			{
				if (versionNumber <= 26)
				{
					num = 1;
				}
				else
				{
					num = 2;
				}
			}
			return this.int_0[num];
		}
		public override string ToString()
		{
			return this.string_0;
		}
		static Mode()
		{
			// Note: this type is marked as 'beforefieldinit'.
			int[] int_ = new int[3];
			Mode.TERMINATOR = new Mode(int_, 0, "TERMINATOR");
			Mode.NUMERIC = new Mode(new int[]
			{
				10,
				12,
				14
			}, 1, "NUMERIC");
			Mode.ALPHANUMERIC = new Mode(new int[]
			{
				9,
				11,
				13
			}, 2, "ALPHANUMERIC");
			int_ = new int[3];
			Mode.STRUCTURED_APPEND = new Mode(int_, 3, "STRUCTURED_APPEND");
			Mode.BYTE = new Mode(new int[]
			{
				8,
				16,
				16
			}, 4, "BYTE");
			Mode.ECI = new Mode(null, 7, "ECI");
			Mode.KANJI = new Mode(new int[]
			{
				8,
				10,
				12
			}, 8, "KANJI");
			Mode.FNC1_FIRST_POSITION = new Mode(null, 5, "FNC1_FIRST_POSITION");
			Mode.FNC1_SECOND_POSITION = new Mode(null, 9, "FNC1_SECOND_POSITION");
		}
	}
}
